package com.clt.ess.gjzw.domain.updateProtectKey;


import com.clt.ess.gjzw.domain.FileData;
import com.clt.ess.gjzw.domain.SignInfo;

import java.io.Serializable;
import java.util.List;

//对称密钥的保护密钥更新协议查询并下载公安下发数据返回参数
public class UpdateProtectKeyCheckResultResponse implements Serializable {
    //命令编码 checkResult
    //必须
    private String taskCode;
    //版本号 1.0
    //必须
    private String version;
    //返回值，0 表示成功，其他表示错误
    //必须
    private String resultCode;
    //返回信息描述
    //必须
    private String resultCodeMsg;
    //业务类型编码，0 表示备案业务，1 表示保护密钥更新业务，2 表示印章撤销，3 表示申请电子印章唯一赋码业务
    //必须
    private String taskTypeCode;
    //文件的处理结果类
    //必须
    private List<FileData> data;
    //签名信息
    //必须
    private SignInfo signInfo;

    /**
     {
         "taskCode": "checkResult",
         "version ": "1.0",
         "resultCode ": "0",
         "resultCodeMsg ": "查询任务结果成功",
         "taskTypeCode": "1",
         "data": [{
             "errorCode": "0",
             "package": {
                 "yzbm": "印章编码",
                 "appSymKeyEnc": "BASE64 编码的应用维护对称密钥密文",
                 "dataSymKeyEnc": "BASE64 编码的数据加密对称密钥密文",
                 "encFile": "公安下发的加密文件"
             }
         }],
         "signInfo": {
             "signAlgorithm ": "1.2.156.10197.1.501",
             "signValue ": " BASE64 编码的签名值"
         }
     }
     */

    public UpdateProtectKeyCheckResultResponse() {
    }

    public UpdateProtectKeyCheckResultResponse(String taskCode, String version, String resultCode, String resultCodeMsg, String taskTypeCode, List<FileData> data, SignInfo signInfo) {
        this.taskCode = taskCode;
        this.version = version;
        this.resultCode = resultCode;
        this.resultCodeMsg = resultCodeMsg;
        this.taskTypeCode = taskTypeCode;
        this.data = data;
        this.signInfo = signInfo;
    }

    public String getTaskCode() {
        return taskCode;
    }

    public void setTaskCode(String taskCode) {
        this.taskCode = taskCode;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultCodeMsg() {
        return resultCodeMsg;
    }

    public void setResultCodeMsg(String resultCodeMsg) {
        this.resultCodeMsg = resultCodeMsg;
    }

    public String getTaskTypeCode() {
        return taskTypeCode;
    }

    public void setTaskTypeCode(String taskTypeCode) {
        this.taskTypeCode = taskTypeCode;
    }

    public List<FileData> getData() {
        return data;
    }

    public void setData(List<FileData> data) {
        this.data = data;
    }

    public SignInfo getSignInfo() {
        return signInfo;
    }

    public void setSignInfo(SignInfo signInfo) {
        this.signInfo = signInfo;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"taskCode\":\"")
                .append(taskCode).append('\"');
        sb.append(",\"version\":\"")
                .append(version).append('\"');
        sb.append(",\"resultCode\":\"")
                .append(resultCode).append('\"');
        sb.append(",\"resultCodeMsg\":\"")
                .append(resultCodeMsg).append('\"');
        sb.append(",\"taskTypeCode\":\"")
                .append(taskTypeCode).append('\"');
        sb.append(",\"data\":")
                .append(data);
        sb.append(",\"signInfo\":")
                .append(signInfo);
        sb.append('}');
        return sb.toString();
    }
}
